class ResourceController {
    constructor() {
        let names = ['Homer', 'Marge', 'Bart', 'Lisa', 'Mo'];
        this.treedata = createSubTree(3, 4, "");
        this.showSelected = function (sel) {
            this.selectedNode = sel;
        };

        function createSubTree(level, width, prefix) {
            if (level > 0) {
                var res = [];
                for (var i = 1; i <= width; i++)
                    res.push({
                        "label": "Node " + prefix + i,
                        "id": "id" + prefix + i,
                        "i": i,
                        "children": createSubTree(level - 1, width, prefix + i + "."),
                        "name": names[i % names.length]
                    });
                return res;
            }
            else
                return [];
        }
    }


}

export default ResourceController;